<%@page import="mp3seller.util.UserInfo"%>
<%@page import="mp3seller.entities.Mp3"%>
<%@page import="java.util.HashMap"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Mp3 Seller</title>
</head>
<body>
	<jsp:include page = "/geral/index.jsp" />
	<h1>Minhas Mp3</h1>
	<%
		HashMap<Long, Mp3> mp3sOwneds = (HashMap<Long, Mp3>) request
			.getAttribute("mp3sOwneds");		
	%>
	<%
		if (mp3sOwneds != null) {
	%>
	<%
		for (Mp3 mp3 : mp3sOwneds.values()) {
	%>
		<a 
			href="ServletMp3?flag=mp3&codigo=<%=mp3.getId()%>&operation=update">id: <%=mp3.getId()%>
			- nome: <%=mp3.getNome()%>  
		</a>  <input type="button" value="Download" onclick="location.href='filesMp3/<%=mp3.getId()%>'">
		<br>
		<%
			}
		%>
	<%
		}
	%>
	<br>
	<%
	if(UserInfo.isAdmin()){ %>	
		<input type="button" value="Adicionar Mp3" onclick="location.href='mp3/mp3.jsp?operation=save'" >
	<%} %>
</body>
</html>